//
// Created by QU on 2023/8/16.
//

#ifndef VHDLSENDER_PARAMPASSER_H
#define VHDLSENDER_PARAMPASSER_H

#include <stdint.h>
#include <stdbool.h>
#include "header.h"
#include "paramPasser.h"

//////////// header //////////////
struct strParameter {
    char structuremode[10];
    char vctype[10];
    char gentype[10];
    char genframenum[50];
    char physicalid[10];
    char logicalid[10];
    char startmfi[10];
    char inputfile[256];
};

struct paramFlag {
    bool structuremode;
    bool vctype;
    bool gentype;
    bool inputfile;
    bool genframenum;
    bool physicalid;
    bool logicalid;
    bool startmfi;
    bool verbose;
};

struct numParameter {
    uint16_t numStructureMode;
    enum VC_TYPE numVCType;
    uint16_t numSplitedCols;

    uint16_t numPhysicalID;
    uint16_t numLogicalID;
    uint16_t numStartMFI;
    enum GENERATE_DATA_TYPE numGenDataType;

    size_t numGenFrameNum;

    char inputfilename[256];
};

/////////////  function ///////////////

void printHelpMessage(char *argv[0]);

struct strParameter parameterPasserToStrParam(int argc, char *argv[]);

struct numParameter parseStrParameterToNumParameter(struct paramFlag flags, struct strParameter strParameter);

static inline bool extractVCTypeValues(const char *inputString, uint16_t *n1, uint16_t *n2);

void printNumParameter(const struct numParameter *params);

void testParamPasser(int argc, char *argv[]);

#endif //VHDLSENDER_PARAMPASSER_H
